<template>
    <div>
       <Card>
        <p slot="title">
            企业详情
        </p>
        <div>
            <Form class="step-form" ref="userData" :model="userData" :label-width="100">
                <Row span="24">
                    <i-col span="12" >
                        <FormItem label="企业名称：" label-position="left" :label-width="150">
                            {{userData.name}}
                        </FormItem>
                    </i-col>
                    <i-col span="12" >
                        <FormItem label="企业地址：" prop="address" label-position="left" :label-width="100">
                            {{userData.address}}
                        </FormItem>
                    </i-col>
                </Row>
                <Row span="24">
                    <i-col span="12" >
                        <FormItem label="法人身份证号：" label-position="left" :label-width="150">
                            {{userData.legalCard}}
                        </FormItem>
                    </i-col>
                    <i-col span="12" >
                        <FormItem label="法人姓名：" label-position="left" :label-width="100">
                            {{userData.legalPerson}}
                        </FormItem>
                    </i-col>
                </Row>
                <Row span="12">
                    <i-col span="12" >
                        <FormItem label="企业类型：" prop="partyType" label-position="left" :label-width="150">
                           <Radio-group v-model="userData.partyType">
                                <Radio :label="1">2P</Radio>
                                <Radio :label="2">4S</Radio>
                                <Radio :label="3">质押监管员</Radio>
                                <Radio :label="4">2B</Radio>
                                <Radio :label="5">小b</Radio>
                                <Radio :label="6">个人</Radio>
                            </Radio-group>
                        </FormItem>
                    </i-col>
                </Row>
                <!--<Row span="12">
                    <i-col span="12" >
                        <FormItem label="手机号：" label-position="left" :label-width="150">
                            <Input :disabled="hasSubmit" v-model="userData.legalPhone" type="text" placeholder="手机号不能为空" />
                        </FormItem>
                    </i-col>
                </Row>
                <Row span="12">
                    <i-col span="12" >
                        <FormItem label="营业执照号：" label-position="left" :label-width="150">
                            <Input :disabled="hasSubmit" v-model="userData.businessLicense" type="text" placeholder="营业执照号不能为空" />
                        </FormItem>
                    </i-col>
                </Row>-->
                <Row span="24">
                    <i-col span="8">
                        <FormItem label="营业执照图片：" label-position="left" :label-width="150">
                            <img v-if="userData.businessLicenseUrl !== ''" :src="userData.businessLicenseUrl" height="200" width="200">
                        </FormItem>
                    </i-col>
                    <i-col span="8">
                        <FormItem label="身份证正面：" label-position="left" :label-width="150">
                            <img v-if="userData.cardUrl !== ''" :src="userData.cardUrl" height="200" width="200">
                        </FormItem>
                    </i-col>
                    <i-col span="8">
                        <FormItem label="身份证背面：" label-position="left" :label-width="150">
                            <img v-if="userData.cardBackUrl !== ''" :src="userData.cardBackUrl" height="200" width="200">
                        </FormItem>
                    </i-col>
                </Row>
                <!--<Row span="12">
                    <i-col span="10">
                        <FormItem label="门头照：" label-position="left" :label-width="150">
                            <img v-if="userData.doorHeaderUrl !== ''" :src="userData.doorHeaderUrl" height="200" width="200">
                        </FormItem>
                    </i-col>
                </Row>-->

                <FormItem style="margin-top:50px;text-align: center;">
                    <Button type="info" @click="back" style="width:150px;" >返回列表</Button>
                </FormItem>
            </Form>
        </div>
    </Card>
    </div>
</template>

<script>
import ajax from '../../../libs/axios.js'
export default {
    name: 'addUser',
    data () {
        return {
            hasSubmit: true,
            // 图片上传
            file: null,
            status: 'wait',
            userId:'',            // 当前登陆人员的id
            uploadLoading: false, // 上传图片时候的加载效果,
            failreason:"",        // 审核失败
            selectData:[],        // 选中数据存储
            partyId:'',           // 当前企业的id
            modal1:false,
            testModelShow:false,
            partyDataModel:false,
            data_loading:false,
            symptomList:[],
            selectModel:[],
            userData: {
                id:'',
                name:'',
                legalPerson:'',
                legalCard:'',
                legalPhone: '',
                businessLicense:'',
                businessLicenseUrl:'',
                cardUrl:'',
                cardBackUrl:'',
                partyType:0,
                doorHeaderUrl:''
            },
        }
    },
    created () {
        this.init()
    },
    activated () {},
    methods: {
        // 数据初始化
        init () {
            this.$store.commit('setActiveName', 'partyindex')
            this.userId = window.localStorage.getItem('userId')
            let id = this.$route.params.id
            this.partyId = id
            this.personalInfo(id)
        },
        // 获取数据
        personalInfo(id){
            let _that = this;
            let url = 'adminlogin/selectCjPartyById'
            let data = {
                id: id
            }
            ajax.formRes(url, data).then(res => {
                // success
                if(200 == res.code){
                    _that.userData = res.data
                }else{
                    _that.$Message.success('数据原因，请联系管理员。')
                }

            }).catch(res => {
                console.log('有错误信息')
                // fail
            })
        },
        //返回至首页
        back(){
            this.$router.push({
                name: 'partyindex'
            })
        }
    },
}
</script>
<style>
    .demo-upload-list-cover{
        display: none;
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(0,0,0,.6);
    }
    .card-upload:hover .demo-upload-list-cover{
        display: block;
    }
    .demo-upload-list-cover i{
        color: #fff;
        font-size: 20px;
        cursor: pointer;
        margin: 0 2px;
    }
    .demo-spin-icon-load{
        animation: ani-demo-spin 1s linear infinite;
    }
    @keyframes ani-demo-spin {
        from { transform: rotate(0deg);}
        50%  { transform: rotate(180deg);}
        to   { transform: rotate(360deg);}
    }
    .demo-spin-col{
        height: 100px;
        position: relative;
        border: 1px solid #eee;
    }

    .small-title{
        font-style: normal;
        font-weight: bold;
        font-size:14px;
    }

    .hide-header-checkbox thead .ivu-checkbox-wrapper {
        display: none !important
    }
</style>

